package com.power.ding.api;

import com.ding.dto.Di_messageDto;
import com.plf.common.domain.ResponseDTO;
import com.power.ding.exception.DingException;
import com.power.ding.model.Di_message;
import com.power.ding.model.Di_todo;
import com.power.ding.model.pageInfo.Di_todoPageInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author xiongzhiwen
 * @version 1.0
 * @description:  赣政通代办信息
 * @date 2024/3/29 18:03
 */
public interface IDi_todoFeign {

     /**
     * 代办任务发送
     */
    @PostMapping("/di_todo/sendToDo")
    ResponseDTO sendToDo(@RequestBody Di_todo todo);

    /**
     * 消息通知发送
     */
    @PostMapping("/di_todo/sendMessage")
    ResponseDTO sendMessage(@RequestBody Di_message message);

    /**
     * 根据接收人id获取待办任务
     *
     * @param pageInfo
     * @return
     * @throws DingException
     */
    @PostMapping("/di_todo/getTodoListByUserid")
    ResponseDTO getTodoListByUserid(@RequestBody Di_todoPageInfo pageInfo) throws DingException;

    /**
     * 根据applyid及类型查询附件信息
     *
     * @param applyid
     * @param mattype
     * @return
     * @throws DingException
     */
    @PostMapping("/di_todo/getAttachByApplyid")
    ResponseDTO getAttachByApplyid(@RequestParam String applyid, Integer mattype);

    /**
     * 上传文件
     *
     * @param file
     * @return
     * @throws Exception
     */
    @PostMapping("/di_todo/upload")
    ResponseDTO uploadFile(@RequestPart("file") MultipartFile file) throws Exception;

    /**
     * 根据applyid mattype 查询被申请人答复书附件
     * @param applyid
     * @param mattype
     * @return
     * @throws Exception
     */
    @PostMapping("/di_todo/getFileListByApplyId")
    ResponseDTO getFileListByApplyId(@RequestParam String applyid, @RequestParam Integer mattype) throws Exception;

    /**
     * 完成待办(被申请人答复)
     *
     * @param id
     * @param files
     * @return
     * @throws DingException
     */
    @PostMapping("/di_todo/finishRespond")
    ResponseDTO finishRespond(@RequestParam String id, @RequestPart("files") List<MultipartFile> files);
}
